import request from '@/utils/request'

/**
 * 获取系统消息列表
 * @param {*} query 
 * @returns 
 */
export function getMessageList(query) {
  return request({
    url: '/sys/message/list',
    method: 'get',
    params: query
  })
}

/**
 * 设置消息已读
 * @param {*} data 
 * @returns 
 */
export function setMessageReaded(data) {
  return request({
    url: '/sys/message',
    method: 'put',
    data: data
  })
}

/**
 * 获取未读消息条数
 * @param {*} query 
 * @returns 
 */
export function selectUnReadMessage(query) {
  return request({
    url: '/sys/message/selectUnReadMessage',
    method: 'get',
    params: query
  })
}

/**
 * 把所有消息设为已读
 * @returns 
 */
export function setMessageAllReaded() {
  return request({
    url: '/sys/message/changeStatus',
    method: 'put'
  })
}